package com.sensePlusVR.widget.dialog;

import android.content.Context;
import android.os.Bundle;
import android.text.Html;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

import com.sensePlusVR.activity.mine.HyperlinkSettingActivity;
import com.sensePlusVR.main.R;
import com.sensePlusVR.setting.bluetooth.BlueScannerActivity;
import com.sensePlusVR.utils.MyLog;
import com.sensePlusVR.utils.MyPageJump;

public class BlueReConnectDialog extends BaseDialog implements OnClickListener{
	private static final String TAG = BlueReConnectDialog.class.getSimpleName();
	private Context context;
	//private LinearLayout blue_reconn_top;
	private Button blue_discon_reconn_btn;
	private TextView blue_discon_shop_tv;
	private Button blue_del_btn;
	
	public BlueReConnectDialog(Context context) {
		super(context);
		this.context = context;
	}
	
	public BlueReConnectDialog(Context context, int theme) {
		super(context, theme);
		this.context = context;
	}
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.dialog_blue_reconnect);
		MyLog.d(TAG, "onCreate...");
		//blue_reconn_top = (LinearLayout) findViewById(R.id.blue_reconn_top);
		blue_discon_reconn_btn = (Button) findViewById(R.id.blue_discon_reconn_btn);
		blue_discon_shop_tv = (TextView) findViewById(R.id.blue_discon_shop_tv);
		blue_del_btn = (Button) findViewById(R.id.blue_del_btn);
		blue_discon_shop_tv.setText(Html.fromHtml("<u>"+context.getResources().getString(R.string.blue_faq_shop)+"</u>"));//下划线
		
		//blue_reconn_top.setOnClickListener(this);
		blue_discon_reconn_btn.setOnClickListener(this);
		blue_discon_shop_tv.setOnClickListener(this);
		blue_del_btn.setOnClickListener(this);
	}
	

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		//case R.id.blue_reconn_top:
		case R.id.blue_del_btn:
			break;
		case R.id.blue_discon_reconn_btn:
			MyPageJump.pageJump(context, BlueScannerActivity.class);
			break;
		case R.id.blue_discon_shop_tv:
			MyPageJump.pageJump(context, HyperlinkSettingActivity.class);
			break;
		}
		if(isShowing())dismiss();
	}

}
